var t = require("../../../@babel/runtime/helpers/interopRequireDefault")(require("../../../utils/util")), a = getApp(), e = new Date().getTime();

Page({
    data: {
        info: [],
        start_time: "",
        end_time: "",
        show1: !1,
        show: !1,
        currentDate: e,
        formatter: function(t, a) {
            return "year" === t ? "".concat(a, "年") : "month" === t ? "".concat(a, "月") : "day" === t ? "".concat(a, "日") : a;
        }
    },
    onLoad: function(t) {},
    onReady: function() {},
    onShow: function() {
        this.getData();
    },
    onHide: function() {},
    onUnload: function() {},
    onPullDownRefresh: function() {},
    onReachBottom: function() {},
    onShareAppMessage: function() {},
    btnCancel: function() {
        console.log("111111111"), this.setData({
            show: !1,
            show1: !1
        });
    },
    showTap: function() {
        this.setData({
            show: !0
        });
    },
    showTap1: function() {
        this.setData({
            show1: !0
        });
    },
    btnFinished: function(a) {
        var e = t.default.formatTimeTwo(a.detail / 1e3, "Y-M-D");
        this.setData({
            start_time: e,
            show: !1
        });
    },
    btnFinished1: function(a) {
        var e = t.default.formatTimeTwo(a.detail / 1e3, "Y-M-D");
        this.setData({
            end_time: e,
            show1: !1
        });
    },
    serach: function() {
        this.setData({
            page: 1,
            current_page: 1,
            last_page: 1
        }), this.getData();
    },
    getData: function() {
        var t = this, e = a.getNetAddresss("plugin.zhp-group-lottery.frontend.contribution.get-old-today-contribution");
        a._postNetWork({
            url: e,
            data: {
                page: this.data.page,
                start_time: this.data.start_time,
                end_time: this.data.end_time
            },
            success: function(a) {
                var e = a.data;
                1 == e.result ? (t.setData({
                    info: e.data.data,
                    gxz_name: e.data.gxz_name,
                    current_page: e.data.current_page,
                    last_page: e.data.last_page
                }), wx.setNavigationBarTitle({
                    title: "往日".concat(e.data.gxz_name, "数量")
                })) : wx.showToast({
                    title: e.msg,
                    duration: 1e3,
                    icon: "none"
                });
            }
        });
    },
    getMore: function() {
        var t = this, e = this, n = a.getNetAddresss("plugin.zhp-group-lottery.frontend.contribution.get-old-today-contribution");
        a._postNetWork({
            url: n,
            data: {
                page: this.data.page,
                start_time: this.data.start_time,
                end_time: this.data.end_time
            },
            success: function(a) {
                var n = a.data;
                1 == n.result ? t.setData({
                    info: e.data.info.concat(n.data.data),
                    current_page: n.data.current_page,
                    last_page: n.data.last_page
                }) : wx.showToast({
                    title: n.msg,
                    duration: 1e3,
                    icon: "none"
                });
            }
        });
    }
});